﻿@page "/daily/notice";
@namespace YwhWeb.Pages.Daily

<div style="text-align: right;">

    <PageContainer Title="公告" Style="right">
        <Content>   
            <Button @onclick="_=>NewDrawer()">添加会议</Button> 
            
            </Content>

        
            <ChildContent>
            <Table @ref="table"
                   TItem="YwhLib.Notice"
                   DataSource="@noticeRsp.Items"
                   Total="_total"
                   @bind-PageIndex="_pageIndex"
                   @bind-PageSize="_pageSize"
                   @bind-SelectedRows="selectedRows"
                   OnChange="OnChange">
                <Selection Key="@(context.NoticeId.ToString())" />
                 <AntDesign.Column Title="记录ID" @bind-Field="@context.NoticeId" Sortable />
                <AntDesign.Column Title="标题" @bind-Field="@context.Title" />
                <AntDesign.Column Title="描述" @bind-Field="@context.Description" />
                <AntDesign.Column Title="内容" @bind-Field="@context.Contetnt" />
                <AntDesign.Column Title="作者" @bind-Field="@context.Author" />
                <AntDesign.Column Title="会议时间" @bind-Field="@context.PubTime" Format="yyyy-MM-dd HH:mm:ss" Sortable />
            </Table>
            </ChildContent>
    </PageContainer>
</div>

<Drawer Visible="this.drawerVisible" Width="500" OnClose="a=>{this.drawerVisible=false;}">
     <Title Level="4">添加公告</Title>
    <div>
    <p ></p>
 </div>

 <Text>标题:</Text>
    <div>
    <Input Placeholder="请输入标题" @bind-Value="@editNotice.Title"  />
    <p></p>
</div>

 <Text>描述:</Text>
    <div>
    <Input Placeholder="请输入描述" @bind-Value="@editNotice.Description"  />
    <p></p>
</div>

<Text>内容:</Text>
<TextArea Rows="4" Placeholder="请输入内容" @bind-Value="@editNotice.Contetnt" />
<p></p>

<Text>作者:</Text>
    <div>
    <AutoComplete @bind-Value="@editNotice.Author" Options="@options" OnSelectionChange="OnSelectionChange"  Placeholder=""/>
    <p></p>
</div>

<Text>会议时间:</Text>
    <div>
    <DatePicker TValue="DateTime" ShowTime="@true"
               DefaultValue=@editNotice.PubTime
               Format="yyyy-MM-dd HH:mm:ss"
               DisabledDate="date => date <= DateTime.Now"
               DisabledTime="date => GetDisabledTime(date)" 
               />
    <p></p>
</div>

<div style="text-align: right;">
    <Button Type="@ButtonType.Primary">保存</Button>
</div>

</Drawer>
